
import java.util.Scanner;

public class czf456 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("请输入投资金额：");
        double principal = scanner.nextDouble();

        System.out.print("请输入年利率（例如，输入 0.05 表示 5%）：");
        double annualInterestRate = scanner.nextDouble();

        double returnAfterOneYear = calculateReturn(principal, annualInterestRate);

        System.out.printf("一年后，投资赎回时获得的本金是：%.2f%n", returnAfterOneYear);

        scanner.close();
    }

    public static double calculateReturn(double principal, double annualInterestRate) {
        return principal * (1 + annualInterestRate);
    }
}
